#include "IndexThread.h"

IndexThread::IndexThread()
{

}


void IndexThread::run()
{
    QStringList indexList;
    indexList << "D:\Qt\weClassRec2";
    /*
    QList<QStorageInfo> devList = QStorageInfo::mountedVolumes();
    foreach(QStorageInfo info, devList)
    {
        if(!info.isValid()) continue;
        if(!info.isReady()) continue;

        indexList << info.rootPath();
    }*/

    QStringList::iterator it = indexList.begin();
    while(it != indexList.end())
    {
        QString path = *it;
        QDir dir(path);
        QFileInfoList infoList = dir.entryInfoList(QDir::NoDotAndDotDot,QDir::Unsorted);
        foreach(QFileInfo info, infoList)
        {
            if(info.isDir()){
                qDebug()<<info.absoluteFilePath()<<"push to check.";
                indexList << info.absoluteFilePath();
            }
            emit sgFileInfo(info);
        }
        it = indexList.erase(it);
    }
}
